﻿<!--#include file="include/Money_ratio.asp"-->
<!--#include file="include/conn_f.asp"-->
<!--#include file="top.asp"-->
<!--#include file="left.asp"-->
<div class="content">
    <br />
    <center>
        <script language="javascript" type="text/javascript">
            function formcheck() {
                if (document.getElementById("gameid")) {
                    if (document.forminfo.gameid.value.length < 1) {
                        alert(forminfo.gameid_name.value + "没有填写!");
                        forminfo.gameid.focus();
                        return (false);
                    }
                }
                if (document.getElementById("gamename")) {
                    if (document.forminfo.gamename.value.length < 1) {
                        alert(forminfo.gamename_name.value + "没有填写!");
                        forminfo.gamename.focus();
                        return (false);
                    }
                }
                if (document.getElementById("server_area")) {
                    if (document.forminfo.server_area.value.length < 1) {
                        alert(forminfo.server_area_name.value + "没有填写!");
                        forminfo.server_area.focus();
                        return (false);
                    }
                }
                if (document.getElementById("servername")) {
                    if (document.forminfo.servername.value.length < 1) {
                        alert(forminfo.servername_name.value + "没有填写!");
                        forminfo.servername.focus();
                        return (false);
                    }
                }

                if (document.forminfo.card_id.value == 271) {
                    if (document.forminfo.amount.value > 8) {
                        alert("超个每日可充Q币数量,每日不能超过1000个Q币!");
                        forminfo.amount.focus();
                        return (false);
                    }
                }
                if (document.forminfo.card_id.value == 316) {
                    if (document.forminfo.amount.value > 33) {
                        alert("超个每日可充Q币数量,每日不能超过1000个Q币!");
                        forminfo.amount.focus();
                        return (false);
                    }
                }
            }
        </script>
        <%
card_id=saferequest("card_id",1)
select_currency=saferequest("select_currency",0)
If Session("cust_id")="" Then
    Response.Write  "请先登录"
    Response.End
End If
sql="select email from customer where cust_id="&Session("cust_id")
Set rs=conn.execute(sql)
If Not rs.eof Then
    email=rs("email")
    Response.Write "<font color='red' size='3'>重要提示:<br />请不要使用他人信用卡付款!!<br />信用卡借给他人使用将导致信用卡被吊销!</font><br /><br />"
    Response.Write "您购买的卡将通过电子邮件发送到:<br /><font color='red'>"&email&"</font><br />"
    Response.Write "如果您未能收到e-mail发来的卡信息，请到'<a href='"&MapUrl("history")&"' target='_blank'><font color='red'>我的定单</font></a>'记录中查询!<br />"
    Response.Write "请注意看定单的状态和工作人员给您发的备注信息.<br /><br />"
    sql="select a.*,b.card_name from card as a left join card_infor as b  on a.card_infor_id=b.card_info_id where card_id="&card_id
    Set rs2=conn.execute(sql)
    If Not rs2.eof Then
        goods_type=rs2("goods_type")
        account_name=rs2("account_name")
        charge_method=rs2("charge_method")
        server_names=rs2("server_names")
        server_area=rs2("server_area")
        price=rs2("price")
        vip_price=rs2("vip_price")
        onsale=rs2("onsale")
        If onsale<>1 Then
            Response.Write "此卡停止销售!"
            Response.End
        End If

        Response.Write "您要购买的卡信息:<br /><table width=450 border=1 cellspacing=0>"
        Response.Write "<tr ><td width='150'>卡名称</td><td width='300'>"&rs2("card_name")&"</td></tr>"
        If rs2("sale_method")<>1 Then
            Response.Write "<tr ><td>面额</td><td>"&rs2("miane")&"</td></tr>"
        End If

        select case select_currency
        case "USD"
            price_cur=FormatNumber( price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
            price_vip_cur=FormatNumber( vip_price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
        case "CAD"
            price_cur=FormatNumber( price*BASE_RT/CAD_RATIO,2 )&"&nbsp;加拿大元"
            price_vip_cur=FormatNumber( vip_price*BASE_RT/CAD_RATIO,2 )&"&nbsp;加拿大元"
        case "GBP"
            price_cur=FormatNumber( price*BASE_RT/GBP_RATIO,2 )&"&nbsp;英磅" 
            price_vip_cur=FormatNumber( vip_price*BASE_RT/GBP_RATIO,2 )&"&nbsp;英磅" 
        case "EUR"
            price_cur=FormatNumber( price*BASE_RT/EUR_RATIO,2 )&"&nbsp;欧元" 
            price_vip_cur=FormatNumber( vip_price*BASE_RT/EUR_RATIO,2 )&"&nbsp;欧元" 
        case "AUD"
            price_cur=FormatNumber( price*BASE_RT/AUD_RATIO,2 )&"&nbsp;澳大利亚元" 
            price_vip_cur=FormatNumber( vip_price*BASE_RT/AUD_RATIO,2 )&"&nbsp;澳大利亚元"
        case "JPY"
            price_cur=FormatNumber( price*BASE_RT/JPY_RATIO,2 )&"&nbsp;日元" 
            price_vip_cur=FormatNumber( vip_price*BASE_RT/JPY_RATIO,2 )&"&nbsp;日元"
        case "SGD"
            price_cur=FormatNumber( price*BASE_RT/SGD_RATIO,2 )&"&nbsp;新加坡元" 
            price_vip_cur=FormatNumber( vip_price*BASE_RT/SGD_RATIO,2 )&"&nbsp;新加坡元"
        case "CNY"
            price_cur=FormatNumber( price,2 )&"&nbsp;元" 
            price_vip_cur=FormatNumber( vip_price,2 )&"&nbsp;元"
        case Else
            price_cur=FormatNumber( price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
            price_vip_cur=FormatNumber( vip_price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
        end  select
        Response.Write "<tr bgcolor=#FFFFFF><td >价格:</td><td>"&price_cur&"</td></tr>"	

        If ISVIP=1 Then
            Response.Write "<tr bgcolor=#FFFFFF><td><font color=red>VIP价(您的价格):</td><td><font color=red>"&price_vip_cur&"</font></td></tr>"	
        End If		
    End If
        %>
        <tr>
            <td>
                购买数量
            </td>
            <td>
                <form action="checkout.asp" method="post" name="forminfo" onsubmit="return formcheck()">
                <input name="card_id" value="<%=card_id%>" type="hidden">
                <select name="amount">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15">15</option>
                    <option value="16">16</option>
                    <option value="17">17</option>
                    <option value="18">18</option>
                    <option value="19">19</option>
                    <option value="20">20</option>
                    <option value="25">25</option>
                    <option value="30">30</option>
                    <option value="35">35</option>
                    <option value="40">40</option>
                    <option value="45">45</option>
                    <option value="50">50</option>
                    <option value="60">60</option>
                    <option value="70">70</option>
                    <option value="80">80</option>
                    <option value="90">90</option>
                    <option value="100">100</option>
                </select>
                张(份)
            </td>
        </tr>
        <%
        If rs2("goods_type")=1 Then
            If account_name<>"" Then
                Response.Write "<tr><td><input type='hidden' name='gameid_name' value='"&account_name&"'><font color=red>"&account_name&"</font></td><td>"
                Response.Write "<input name='gameid' id='gameid' size=20 />"				
                Response.Write "</td></tr>"
            End If
            If charge_method<>"" Then
                Response.Write "<tr><td><input type='hidden' name='gamename_name' value='"&charge_method&"'><font color=red>"&charge_method&"</font></td><td>"
                sql="select * from charge_option where option_number=1 and status=1 and card_id="&card_id&" order by option_name"
                Set rsoption=conn.execute(sql)
                If Not rsoption.eof Then
                    Response.Write "<select name='gamename' id='gamename' />"
                    Response.Write "<option value=''>--请选择--</option>"
                    while Not rsoption.eof
                        Response.Write "<option value='"&rsoption("charge_option_id")&"'>"&rsoption("option_name")&"</option>"
                        rsoption.movenext
                    wend
                    Response.Write "</select>"
                    Response.Write "<input name='gamename_selected' type='hidden' value='1' />"
                Else
                    Response.Write "<input name='gamename' id='gamename' size=20 >"
                End If
                Response.Write "</td></tr>"
            End If
            If server_area<>"" Then
                Response.Write "<tr><td><input type='hidden' name='server_area_name' value='"&server_area&"'><font color=red>"&server_area&"</font></td><td>"
                sql="select * from charge_option where option_number=2 and status=1 and card_id="&card_id
                Set rsoption=conn.execute(sql)
                If Not rsoption.eof Then
                    Response.Write "<select name='server_area' id='server_area'>"
                    Response.Write "<option value=''>--请选择--</option>"
                    while Not rsoption.eof
                        Response.Write "<option value='"&rsoption("option_name")&"'>"&rsoption("option_name")&"</option>"
                        rsoption.movenext
                    wend
                    Response.Write "</select>"
                Else
                    Response.Write "<input name='server_area' id='server_area' size=20 />"
                End If				
                Response.Write "</td></tr>"
            End If
            If server_names<>"" Then
                Response.Write "<tr><td><input type='hidden' name='servername_name' value='"&server_names&"'><font color=red>"&server_names&"</font></td><td>"
                sql="select * from charge_option where option_number=3 and status=1 and card_id="&card_id
                Set rsoption=conn.execute(sql)
                If Not rsoption.eof Then
                    Response.Write "<select name='servername' id='servername'>"
                    Response.Write "<option value=''>--请选择--</option>"
                    while Not rsoption.eof
                        Response.Write "<option value='"&rsoption("option_name")&"'>"&rsoption("option_name")&"</option>"
                        rsoption.movenext
                    wend
                    Response.Write "</select>"
                Else
                    Response.Write "<input name='servername' id='servername' size=20 />"
                End If				
                Response.Write "</td></tr>"
            End If
        %>
        <tr>
            <td>
                备注
            </td>
            <td>
                <textarea name="memo_cust" rows="4" cols="30"></textarea>
            </td>
        </tr>
        <%
        End If
        %>
        <tr>
            <td colspan="2" align="center">
                <input type="submit" value="确定">
            </td>
        </tr>
        </form> </table>
        <%
End If
        %>
</div>
<!--#include file="bottom.asp"-->
